<?php
use \think\Route;
Route::get('/','index/Index/index');
Route::get('/test','index/Index/test');
Route::miss(function(){
    echo json_encode(['code' => -2,'msg' => '请求错误,请检查路由!','data' => []]);exit;    
});
//后台路由
Route::group('admin',function(){
    Route::post('login','admin/LoginController/login');             //登录
    Route::group('user',function(){
        Route::post('index','admin/UserController/index');          //用户列表
    });
    Route::group('brand',function(){
        Route::post('index','admin/BrandController/index');         //品牌列表    
    });
    Route::group('video',function(){
        Route::post('index','admin/VideoController/index');         //视频列表
        Route::post('log','admin/VideoController/log');             //推送记录
    });
    Route::group('board',function(){
        Route::post('info','admin/BoardController/info');           //面板数据    
    });
    Route::group('index',function(){
        Route::post('options','admin/BoardController/options');     //下拉列表
    });
    Route::group('tasktype',function(){
        Route::post('index','admin/TaskController/index');          //类型列表
        Route::post('create','admin/TaskController/create');        //添加类型
        Route::post('delete','admin/TaskController/delete');        //删除类型
        Route::post('edit','admin/TaskController/edit');            //编辑类型
    });
});
//前台路由
Route::get('test1','api/LoginController/test1');                    //测试路由
Route::group('api',function(){
    Route::group('user',function(){
        Route::post('login','api/LoginController/login');           //登录
        Route::post('test','api/LoginController/test');
    });
    Route::group('brand',function(){
        Route::post('create','api/BrandController/create');         //新增品牌
        Route::post('index','api/BrandController/index');           //品牌列表
        Route::post('edit','api/BrandController/edit');             //编辑品牌
        Route::post('delete','api/BrandController/delete');         //删除品牌
        Route::post('remark','api/BrandController/remark');         //品牌备注
        Route::post('check','api/BrandController/check');           //检查产品
    });
    Route::group('video',function(){
        Route::post('index','api/VideoController/index');           //视频列表
        Route::post('upload','api/VideoController/upload');         //视频上传
        Route::post('push','api/VideoController/push');             //视频推送
        Route::post('log','api/VideoController/log');               //推送记录
        Route::post('advertiser','api/VideoController/advertiser'); //广告主信息
        Route::post('check','api/VideoController/check_again');     //重新检测
        Route::post('history','api/VideoController/history');       //推送历史
        Route::post('delete','api/VideoController/delete');         //删除视频
    });
    Route::group('tos',function(){
        Route::post('token','api/TosController/token');             //获取临时凭证
    });
    Route::group('index',function(){
        Route::post('options','api/IndexController/options');       //下拉列表
        Route::post('board','api/IndexController/board');           //面板数据
        Route::post('list','api/IndexController/index');            //消耗列表
        Route::post('export','api/IndexController/export');         //消耗下载
    });
    Route::group('task',function(){
        Route::post('create','api/TaskController/create');          //任务创建
        Route::post('index','api/TaskController/index');            //任务列表
        Route::post('info','api/TaskController/info');              //任务详情
        Route::post('edit','api/TaskController/edit');              //任务处理
        Route::post('delete','api/TaskController/delete');          //任务删除
        Route::post('overview','api/TaskController/overview');      //任务概览
    });
    Route::post('send','api/MessageController/send');               //发送邮件 
});
